/*
 * Copyright (C) 2023 Coder.AN
 * Email: an.hongjun@foxmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
#ifndef __XBOX_FILTER_H__
#define __XBOX_FILTER_H__

#include "xbox.h"


// 设定死区
#define DIE_X1      5000
#define DIE_Y1      5000    
#define DIE_X2      5000
#define DIE_Y2      5000

// 最大值
#define MAX_X1      30000 - DIE_X1
#define MAX_Y1      30000 - DIE_Y1
#define MAX_X2      20000 - DIE_X2
#define MAX_Y2      20000 - DIE_Y2

// 最小值
#define MIN_X1      -30000 + DIE_X1
#define MIN_Y1      -30000 + DIE_Y1
#define MIN_X2      -20000 + DIE_X2
#define MIN_Y2      -20000 + DIE_Y2

// 归一化最大值
#define STD_MAX_X1  200
#define STD_MAX_Y1  30
#define STD_MAX_X2  1800
#define STD_MAX_Y2  1800
#define STD_MAX_LT  1000
#define STD_MAX_RT  1000

// 归一化最小值
#define STD_MIN_X1  -200
#define STD_MIN_Y1  -30
#define STD_MIN_X2  -1800
#define STD_MIN_Y2  -1800
#define STD_MIN_LT  0
#define STD_MIN_RT  0


void xbox_filter(struct XBoxInputVal &val);

#endif